/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package seminario.entidade;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author bpmlab
 */
@Entity
@Table(name = "participante")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Participante.findAll", query = "SELECT p FROM Participante p"),
    @NamedQuery(name = "Participante.findById", query = "SELECT p FROM Participante p WHERE p.id = :id"),
    @NamedQuery(name = "Participante.findByNome", query = "SELECT p FROM Participante p WHERE p.nome = :nome"),
    @NamedQuery(name = "Participante.findByEndereco", query = "SELECT p FROM Participante p WHERE p.endereco = :endereco"),
    @NamedQuery(name = "Participante.findBySexo", query = "SELECT p FROM Participante p WHERE p.sexo = :sexo"),
    @NamedQuery(name = "Participante.findByRg", query = "SELECT p FROM Participante p WHERE p.rg = :rg"),
    @NamedQuery(name = "Participante.findByEmail", query = "SELECT p FROM Participante p WHERE p.email = :email"),
    @NamedQuery(name = "Participante.findByFone", query = "SELECT p FROM Participante p WHERE p.fone = :fone"),
    @NamedQuery(name = "Participante.findByInstituicao", query = "SELECT p FROM Participante p WHERE p.instituicao = :instituicao"),
    @NamedQuery(name = "Participante.findByModalidade", query = "SELECT p FROM Participante p WHERE p.modalidade = :modalidade"),
    @NamedQuery(name = "Participante.findBySituacao", query = "SELECT p FROM Participante p WHERE p.situacao = :situacao")})
public class Participante implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "nome")
    private String nome;
    @Basic(optional = false)
    @Column(name = "endereco")
    private String endereco;
    @Basic(optional = false)
    @Column(name = "sexo")
    private Character sexo;
    @Basic(optional = false)
    @Column(name = "rg")
    private String rg;
    @Basic(optional = false)
    @Column(name = "email")
    private String email;
    @Basic(optional = false)
    @Column(name = "fone")
    private String fone;
    @Basic(optional = false)
    @Column(name = "instituicao")
    private String instituicao;
    @Basic(optional = false)
    @Column(name = "modalidade")
    private String modalidade;
    @Lob
    @Column(name = "resumo")
    private byte[] resumo;
    @Column(name = "situacao")
    private String situacao;
    @OneToMany(mappedBy = "participante")
    private List<Usuario> usuarioList;

    public Participante() {
    }

    public Participante(Integer id) {
        this.id = id;
    }

    public Participante(Integer id, String nome, String endereco, Character sexo, String rg, String email, String fone, String instituicao, String modalidade) {
        this.id = id;
        this.nome = nome;
        this.endereco = endereco;
        this.sexo = sexo;
        this.rg = rg;
        this.email = email;
        this.fone = fone;
        this.instituicao = instituicao;
        this.modalidade = modalidade;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public String getEndereco() {
        return endereco;
    }

    public void setEndereco(String endereco) {
        this.endereco = endereco;
    }

    public Character getSexo() {
        return sexo;
    }

    public void setSexo(Character sexo) {
        this.sexo = sexo;
    }

    public String getRg() {
        return rg;
    }

    public void setRg(String rg) {
        this.rg = rg;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFone() {
        return fone;
    }

    public void setFone(String fone) {
        this.fone = fone;
    }

    public String getInstituicao() {
        return instituicao;
    }

    public void setInstituicao(String instituicao) {
        this.instituicao = instituicao;
    }

    public String getModalidade() {
        return modalidade;
    }

    public void setModalidade(String modalidade) {
        this.modalidade = modalidade;
    }

    public byte[] getResumo() {
        return resumo;
    }

    public void setResumo(byte[] resumo) {
        this.resumo = resumo;
    }

    public String getSituacao() {
        return situacao;
    }

    public void setSituacao(String situacao) {
        this.situacao = situacao;
    }

    @XmlTransient
    public List<Usuario> getUsuarioList() {
        return usuarioList;
    }

    public void setUsuarioList(List<Usuario> usuarioList) {
        this.usuarioList = usuarioList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Participante)) {
            return false;
        }
        Participante other = (Participante) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "seminario.entidade.Participante[ id=" + id + " ]";
    }
    
}
